#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>

int main(int argc, char ** argv){
  int i;
  char *str;
  int file;
  int target;
  str = malloc(14);

  str[0] = (char) argc;
  write(1,str,1);
  

  file = open("test.txt", O_RDWR | O_APPEND);
  target = open("result", O_RDWR | O_TRUNC);
  read(file, str, 14);
  write(target,str,13);


}

